﻿Imports Mysoft.Map.LMS
Partial Public Class LogCollectDispose
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim ip As String = Request.UserHostAddress

        Dim urlStartDate As String = Request("StartDate")
        Dim urlEndDate As String = Request("EndDate")
        Dim urlIISLog As String = Request("IISLog")
        Dim urlWindowsLog As String = Request("WindowsLog")
        Dim urlErpExceptionLog As String = Request("ErpExceptionLog")
        Dim urlErpVisitLog As String = Request("ErpVisitLog")
        Dim urlErpUserQuantity As String = Request("ErpUserQuantity")
        Dim urlErpDBSpaceInfo As String = Request("ErpDBSpaceInfo")
        Dim urlErpDBIndexInfo As String = Request("ErpDBIndexInfo")
        Dim urlServerInfo As String = Request("ServerInfo")

        Dim collectFacde As CollectFacde = New CollectFacde()

        If (urlStartDate IsNot Nothing And urlEndDate IsNot Nothing And urlIISLog IsNot Nothing And urlWindowsLog IsNot Nothing And urlErpExceptionLog IsNot Nothing And urlErpVisitLog IsNot Nothing And urlErpUserQuantity IsNot Nothing And urlErpDBSpaceInfo IsNot Nothing And urlErpDBIndexInfo IsNot Nothing And urlServerInfo IsNot Nothing) Then

            Dim startDate As DateTime
            If (urlStartDate IsNot Nothing) Then
                startDate = Convert.ToDateTime(urlStartDate)
            End If
            Dim endDate As DateTime
            If (urlEndDate IsNot Nothing) Then
                endDate = Convert.ToDateTime(urlEndDate)
            End If
            Dim iISLog As Boolean = urlIISLog = "1"
            Dim windowsLog As Boolean = urlWindowsLog = "1"
            Dim erpExceptionLog As Boolean = urlErpExceptionLog = "1"
            Dim erpVisitLog As Boolean = urlErpVisitLog = "1"
            Dim erpUserQuantity As Boolean = urlErpUserQuantity = "1"
            Dim erpDBSpaceInfo As Boolean = urlErpDBSpaceInfo = "1"
            Dim erpDBIndexInfo As Boolean = urlErpDBIndexInfo = "1"
            Dim serverInfo As Boolean = urlServerInfo = "1"

            If (startDate <> DateTime.MinValue And endDate <> DateTime.MinValue) Then
                collectFacde.CollectDispose(ip, startDate, endDate, iISLog, windowsLog, erpExceptionLog, erpVisitLog, erpUserQuantity, erpDBSpaceInfo, erpDBIndexInfo, serverInfo, "System, Application")
            End If
        Else
            collectFacde.CollectDispose(ip)
        End If

    End Sub

End Class